package com.panshi.service;

import com.panshi.vo.DataResult;
import com.panshi.vo.SysAdmin;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;

@Component
@Api(tags = "后台管理员")
@FeignClient(value = "hasbei-sys-provider",contextId = "admin")
public interface IAdminApp {

    @ApiOperation("admin-查询所有管理员")
    @GetMapping(value = "/sys-app/list")
    public DataResult findAdmin();

    @ApiOperation("admin-根据admin_id查询admin")
    @GetMapping(value = "/admin-app/byid/{id}")
    SysAdmin findAdminById(@PathVariable("id") Integer id);

    @ApiOperation("admin-增加管理员")
    @PostMapping(value = "/admin-app/upd/")
    Boolean upd(@Validated SysAdmin sysAdmin);

    @ApiOperation("admin-修改管理员")
    @PostMapping(value = "/admin-app/add")
    public Boolean add(@Validated SysAdmin sysAdmin);

    @ApiOperation("admin-删除管理员")
    @GetMapping(value = "/admin-app/del/{id}")
    public Boolean del(@PathVariable("id") Integer id);

    @ApiOperation("admin-查询所有管理员所属权限")
    @GetMapping("/admin-app/grade")
    public List<SysAdmin> findAdminGrade();



}
